import { AbstractSearchArgument, AbstractFormArgument } from '../../global'
import { CONDITION_TYPE, DATE_PICKER_SHOW_TYPE } from '@/utils/constants'

const SEARCH_CONDITION = [
  {
    name: 'day',
    title: '日期',
    type: CONDITION_TYPE.DATE,
    value: '',
    visible: true,
    config: {
      type: DATE_PICKER_SHOW_TYPE.DATE,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd'
    }
  },
  {
    name: 'resoure',
    title: '来源',
    placeholder: '--请选择来源--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: false,
    config: {
      list: [
        {value: 1, label: '百度搜索'},
        {value: 2, label: '今日头条'},
        {value: 3, label: '神马搜索'},
        {value: 4, label: '搜狗搜索'},
        {value: 5, label: '搜狗竞价'}
      ]
    }
  },
  {
    name: 'intention',
    title: '意向',
    placeholder: '--请选择意向--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: false,
    config: {
      list: [
        {value: 'A', label: 'A'},
        {value: 'B', label: 'B'},
        {value: 'C', label: 'C'},
        {value: 'D', label: 'D'}
      ]
    }
  },
  {
    name: 'firstAnswer',
    title: '首次接听',
    placeholder: '--请选择接听状态--',
    type: CONDITION_TYPE.SELECT,
    value: '',
    visible: true,
    config: {
      list: [
        {value: 1, label: '接听'},
        {value: 2, label: '拒接'},
        {value: 3, label: '拒绝'},
        {value: 4, label: '空错号'},
        {value: 5, label: '无人接听'},
        {value: 6, label: '无咨询'}
      ]
    }
  },
  {
    name: 'customerName',
    title: '员工',
    placeholder: '请输入员工姓名',
    type: CONDITION_TYPE.TEXT,
    value: '',
    visible: false
  }
]

class SearchArgument extends AbstractSearchArgument {
  constructor () {
    super()

    this.day = ''
    this.resoure = ''
    this.intention = ''
    this.firstAnswer = ''
    this.customerName = ''
  }
}

class FormArgument extends AbstractFormArgument {
  constructor () {
    super()

    this.day = ''
    this.customerName = ''
    this.intention = ''
    this.firstAnswer = ''
    this.resoure = ''
    this.mobile = ''
    this.province = ''
    this.city = ''
    this.qq = ''
    this.wechat = ''
    this.remark = ''
    this.keyword = ''
    this.communication = ''
  }
}

export {
  SEARCH_CONDITION,
  SearchArgument,
  FormArgument
}
